-- Data types for managing books and magazines.

data BookInfo = Book Int String [String] deriving (Show)

data MagazineInfo = Magazine Int String [String] deriving (Show)

type CustomerID = Int
type ReviewBody = String

data BookReview = BookReview BookInfo CustomerID String
data BetterReview = BetterReview BookInfo CustomerID ReviewBody

type BookRecord = (BookInfo, BookReview)


type CardHolder = String
type CardNumber = String
type Address = [String]

data BillingInfo = CreditCard CardHolder CardNumber Address
                 | CashOnDelivery
                 | Invoice CustomerID
                   deriving (Show)

myInfo = Book 9780135072455 "Algebra of Programming"
         ["Richard Bird", "Oege de Moor"]


data Customer = Customer {
      customerID :: CustomerID,
      customerName :: String,
      customerAddress :: Address
      } deriving (Show)
